// pages/com.js

Page({

    /**
     * 组件的初始数据
     */
    data: {
        titleList: [{
            id: 'page',
            pages: [
                {
                    zh: '我的名片',
                    url: '../../pages/myCard/index',
                    iconUrl: '../../image/card-off.png',
                    openType: 'switchTab'
                },
                {
                    zh: '我的团队',
                    url: '../../pages/myTeam/index',
                    iconUrl: '../../image/team.png',
                    openType: 'navigate'
                },
                {
                    zh: '创建团队',
                    url: '../../pages/createTeam/index',
                    iconUrl: '../../image/create.png',
                    openType: 'navigate'
                }
            ]
        }],
        publishIconUrl: '../../image/publish.png',
        hideIconUrl: '../../image/hide.png',
        editCardUrl: '../../pages/editCard/index'
    },

    onLoad: function () {
        console.log('*->onLoad');
        console.log("wx: ", wx);
        console.log("Object.getOwnPropertyNames(wx): ", Object.getOwnPropertyNames(wx).filter(v => v.startsWith('getU')));
        let that = this;
        //调用应用实例的方法获取全局数据
        wx.getUserInfo({
            success: function (res) {
                //更新数据
                console.log("res: ", res);
                that.setData({
                    userInfo: res.userInfo
                })
            }
        })
    },

    onShow: function () {
        let list = wx.getStorageSync("list")[0];
    },

    onReady: function () {
        // Do something when page ready.
        console.log("___onReady")
    },

    switchChange: function (e) {
        console.log('switch1 发生 change 事件，携带值为', e.detail.value)
    },
});
